The logging line number and file was for the previous call position, not for where the actual log entry was called Also fix for ErrorMessage class calls with shifting the start position up depending on which method is called. Output shows file and line where the message/log call was done and the function/class method where the log call was done
4 lines
31 KiB
JavaScript
4 lines
31 KiB
JavaScript
function errorCatch(err){err.stack?err.lineNumber?console.error("ERROR[%s:%s] ",err.name,err.lineNumber,err):err.line?console.error("ERROR[%s:%s] ",err.name,err.line,err):console.error("ERROR[%s] ",err.name,err):err.number?(console.error("ERROR[%s:%s] %s",err.name,err.number,err.message),console.error("ERROR[description] %s",err.description)):console.error("ERROR[%s] %s",err.name,err.message)}function isFunction(name){return typeof window[name]<"u"&&typeof window[name]=="function"}function executeFunctionByName(functionName,context){var args=Array.prototype.slice.call(arguments,2),namespaces=functionName.split("."),func=namespaces.pop();if(func==null)throw new Error("Cannot get function from namespaces: "+functionName);for(var i=0;i<namespaces.length;i++)context=context[namespaces[i]];return context[func].apply(context,args)}function runFunction(name){var args=Array.prototype.slice.call(arguments,1);runFunctionArgsArray(name,args)}function runFunctionArgsArray(name,args){var fn=window[name];typeof fn=="function"&&fn.apply(window,args)}function isObject(val){return val!==null&&typeof val=="object"&&!Array.isArray(val)}function isArray(val){return val!==null&&Array.isArray(val)}function isIterable(val){return val==null?!1:typeof val[Symbol.iterator]=="function"&&typeof val!="string"?!0:typeof val=="object"&&val.constructor===Object}function getObjectCount(object){return isObject(object)?Object.keys(object).length:-1}function keyInObject(key,object){return objectKeyExists(object,key)}function objectKeyExists(object,key){return!!Object.prototype.hasOwnProperty.call(object,key)}function getKeyByValue(object,value){return Object.keys(object).find(key=>object[key]===value)??""}function valueInObject(object,value){return objectValueExists(object,value)}function objectValueExists(object,value){return!!Object.keys(object).find(key=>object[key]===value)}function deepCopyFunction(inObject){var outObject,value,key;if(typeof inObject!="object"||inObject===null)return inObject;outObject=Array.isArray(inObject)?[]:{};for(key in inObject)value=inObject[key],outObject[key]=deepCopyFunction(value);return outObject}function loadEl(el_id){let el=document.getElementById(el_id);if(el===null)throw new Error("Cannot find: "+el_id);return el}function pop(theURL,winName,features){let __winName=window.open(theURL,winName,features);__winName?.focus()}function expandTA(ta_id){let ta=this.loadEl(ta_id);if(ta instanceof HTMLElement&&ta.getAttribute("type")!=="textarea")throw new Error("Element is not a textarea: "+ta_id);let maxChars=parseInt(ta.getAttribute("cols")??"0"),ta_value=ta.getAttribute("value"),theRows=[];ta_value!=null&&(theRows=ta_value.split(`
|
|
`));for(var numNewRows=0,i=0;i<theRows.length;i++)theRows[i].length+2>maxChars&&(numNewRows+=Math.ceil((theRows[i].length+2)/maxChars));ta.setAttribute("row",(numNewRows+theRows.length).toString())}function exists(id){return $("#"+id).length>0}var HtmlElementCreator=class{cel(tag,id="",content="",css=[],options={}){return{tag,id,name:options.name,content,css,options,sub:[]}}ael(base,attach,id=""){if(id){if(base.id==id)base.sub.push(deepCopyFunction(attach));else if(isArray(base.sub)&&base.sub.length>0)for(var i=0;i<base.sub.length;i++)this.ael(base.sub[i],attach,id)}else base.sub.push(deepCopyFunction(attach));return base}aelx(base,...attach){for(var i=0;i<attach.length;i++)base.sub.push(deepCopyFunction(attach[i]));return base}aelxar(base,attach){for(var i=0;i<attach.length;i++)base.sub.push(deepCopyFunction(attach[i]));return base}rel(base){return base.sub=[],base}rcssel(_element,css){var css_index=_element.css.indexOf(css);return css_index>-1&&_element.css.splice(css_index,1),_element}acssel(_element,css){var css_index=_element.css.indexOf(css);return css_index==-1&&_element.css.push(css),_element}scssel(_element,rcss,acss){return this.rcssel(_element,rcss),this.acssel(_element,acss),_element}phfo(tree){let name_elements=["button","fieldset","form","iframe","input","map","meta","object","output","param","select","textarea"],skip_options=["id","name","class"],no_close=["input","br","img","hr","area","col","keygen","wbr","track","source","param","command","base","meta","link","embed"];var content=[],line="<"+tree.tag,i;if(tree.id&&(line+=' id="'+tree.id+'"',name_elements.includes(tree.tag)&&(line+=' name="'+(tree.name?tree.name:tree.id)+'"')),isArray(tree.css)&&tree.css.length>0){for(line+=' class="',i=0;i<tree.css.length;i++)line+=tree.css[i]+" ";line=line.slice(0,-1),line+='"'}if(isObject(tree.options))for(let[key,item]of Object.entries(tree.options))skip_options.includes(key)||(line+=" "+key+'="'+item+'"');if(line+=">",content.push(line),isArray(tree.sub)&&tree.sub.length>0)for(tree.content&&content.push(tree.content),i=0;i<tree.sub.length;i++)content.push(this.phfo(tree.sub[i]));else tree.content&&content.push(tree.content);return no_close.includes(tree.tag)||content.push("</"+tree.tag+">"),content.join("")}phfa(list){for(var content=[],i=0;i<list.length;i++)content.push(this.phfo(list[i]));return content.join("")}};var dom=new HtmlElementCreator;function escapeHtml(string){return string.replace(/[&<>"'/]/g,function(s){var entityMap={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return entityMap[s]})}function unescapeHtml(string){return string.replace(/&[#\w]+;/g,function(s){var entityMap={"&":"&","<":"<",">":">",""":'"',"'":"'","/":"/"};return entityMap[s]})}function html_options(name,data,selected="",options_only=!1,return_string=!1,sort=""){return this.html_options_block(name,data,selected,0,options_only,return_string,sort)}function html_options_block(name,data,selected="",multiple=0,options_only=!1,return_string=!1,sort="",onchange=""){var content=[],element_select,select_options={},element_option,data_list=[],value,options={};multiple>0&&(select_options.multiple="",multiple>1&&(select_options.size=multiple)),onchange&&(select_options.OnChange=onchange),element_select=dom.cel("select",name,"",[],select_options),sort=="keys"?data_list=Object.keys(data).sort():sort=="values"?data_list=Object.keys(data).sort((a,b)=>(""+data[a]).localeCompare(data[b])):data_list=Object.keys(data);for(let key of data_list)value=data[key],options={label:value,value:key,selected:""},multiple==0&&!Array.isArray(selected)&&selected==key&&(options.selected=""),multiple==1&&Array.isArray(selected)&&selected.indexOf(key)!=-1&&(options.selected=""),element_option=dom.cel("option","",value,[],options),dom.ael(element_select,element_option);if(options_only)if(return_string){for(var i=0;i<element_select.sub.length;i++)content.push(dom.phfo(element_select.sub[i]));return content.join("")}else return element_select.sub;else return return_string?(content.push(dom.phfo(element_select)),content.join("")):element_select}function html_options_refill(name,data,sort=""){var element_option,option_selected,data_list=[],value;if(document.getElementById(name)){sort=="keys"?data_list=Object.keys(data).sort():sort=="values"?data_list=Object.keys(data).sort((a,b)=>(""+data[a]).localeCompare(data[b])):data_list=Object.keys(data),[].forEach.call(document.querySelectorAll("#"+name+" :checked"),function(elm){option_selected=elm.value}),loadEl(name).innerHTML="";for(let key of data_list)value=data[key],element_option=document.createElement("option"),element_option.label=value,element_option.value=key,element_option.innerHTML=value,key==option_selected&&(element_option.selected=!0),loadEl(name).appendChild(element_option)}}function dec2hex(dec){return("0x"+dec.toString(16)).substring(-2)}function getRandomIntInclusive(min,max){return min=Math.ceil(min),max=Math.floor(max),Math.floor(Math.random()*(max-min+1)+min)}function roundPrecision(number,precision){return isNaN(number)||isNaN(precision)?number:Math.round(number*Math.pow(10,precision))/Math.pow(10,precision)}function formatString(string,...args){return string.replace(/{(\d+)}/g,function(match,number){return typeof args[number]<"u"?args[number]:match})}function numberWithCommas(number){var parts=number.toString().split(".");return parts[0]=parts[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),parts.join(".")}function convertLBtoBR(string){return string.replace(/(?:\r\n|\r|\n)/g,"<br>")}function getTimestamp(){var date=new Date;return date.getTime()}function generateId(len){var arr=new Uint8Array((len||40)/2);return(window.crypto||window.msCrypto).getRandomValues(arr),Array.from(arr,self.dec2hex).join("")}function randomIdF(){return Math.random().toString(36).substring(2)}function getWindowSize(){var width,height;return width=window.innerWidth||window.document.documentElement.clientWidth||window.document.body.clientWidth,height=window.innerHeight||window.document.documentElement.clientHeight||window.document.body.clientHeight,{width,height}}function getScrollOffset(){var left,top;return left=window.pageXOffset||window.document.documentElement.scrollLeft||window.document.body.scrollLeft,top=window.pageYOffset||window.document.documentElement.scrollTop||window.document.body.scrollTop,{left,top}}function getScrollOffsetOpener(){var left,top;return left=opener.window.pageXOffset||opener.document.documentElement.scrollLeft||opener.document.body.scrollLeft,top=opener.window.pageYOffset||opener.document.documentElement.scrollTop||opener.document.body.scrollTop,{left,top}}function setCenter(id,left,top){var dimensions={height:$("#"+id).height()??0,width:$("#"+id).width()??0},type=$("#"+id).css("position"),viewport=this.getWindowSize(),offset=this.getScrollOffset();if(left&&$("#"+id).css({left:viewport.width/2-dimensions.width/2+offset.left+"px"}),top){var top_pos=type=="fixed"?viewport.height/2-dimensions.height/2:viewport.height/2-dimensions.height/2+offset.top;$("#"+id).css({top:top_pos+"px"})}}function goToPos(element,offset=0,duration=500,base="body,html"){try{let element_offset=$("#"+element).offset();if(element_offset==null)return;$("#"+element).length&&$(base).animate({scrollTop:element_offset.top-offset},duration)}catch(err){errorCatch(err)}}function goTo(target){loadEl(target).scrollIntoView({behavior:"smooth"})}function formatBytes(bytes){var i=-1;if(typeof bytes=="bigint"&&(bytes=Number(bytes)),isNaN(bytes))return bytes.toString();do bytes=bytes/1024,i++;while(bytes>99);return Math.round(bytes*Math.pow(10,2))/Math.pow(10,2)+["kB","MB","GB","TB","PB","EB"][i]}function formatBytesLong(bytes){if(typeof bytes=="bigint"&&(bytes=Number(bytes)),isNaN(bytes))return bytes.toString();let negative=!1;bytes<0&&(negative=!0,bytes*=-1);var i=Math.floor(Math.log(bytes)/Math.log(1024)),sizes=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];return(negative?"-":"")+((bytes/Math.pow(1024,i)).toFixed(2)+" "+sizes[i]).toString()}function stringByteFormat(bytes,raw=!1){if(!(typeof bytes=="string"||bytes instanceof String))return bytes.toString();let valid_units="bkmgtpezy",regex=/([\d.,]*)\s?(eb|pb|tb|gb|mb|kb|e|p|t|g|m|k|b)$/i,matches=bytes.match(regex);if(matches!==null){let m1=parseFloat(matches[1].replace(/[^0-9.]/,"")),m2=matches[2].replace(/[^bkmgtpezy]/i,"").charAt(0).toLowerCase();m2&&(bytes=m1*Math.pow(1024,valid_units.indexOf(m2)))}return raw?bytes:Math.round(bytes)}function parseQueryString(query="",return_key="",single=!1){return getQueryStringParam(return_key,query,single)}function getQueryStringParam(search="",query="",single=!1){query||(query=window.location.href);let url=new URL(query),param=null;if(search){let _params=url.searchParams.getAll(search);_params.length==1||single===!0?param=_params[0]:_params.length>1&&(param=_params)}else{param={};for(let[key]of url.searchParams.entries())if(typeof param[key]>"u"){let _params=url.searchParams.getAll(key);param[key]=_params.length<2||single===!0?_params[0]:_params}}return param}function hasUrlParameter(key){var urlParams=new URLSearchParams(window.location.search);return urlParams.has(key)}function getUrlParameter(key){var urlParams=new URLSearchParams(window.location.search);return urlParams.get(key)}function updateUrlParameter(key,value,reload=!1){let url=new URL(window.location.href);url.searchParams.set(key,value);let newUrl=url.toString();window.history.pushState({path:newUrl},"",newUrl),reload&&window.location.reload()}function removeUrlParameter(key,reload=!1){let url=new URL(window.location.href);url.searchParams.delete(key),window.history.pushState({},"",url.toString()),reload&&window.location.reload()}function loginLogout(){let form=document.createElement("form");form.method="post";let hiddenField=document.createElement("input");hiddenField.type="hidden",hiddenField.name="login_logout",hiddenField.value="Logout",form.appendChild(hiddenField),document.body.appendChild(form),form.submit()}function actionIndicator(loc,overlay=!0){$("#indicator").is(":visible")?this.actionIndicatorHide(loc,overlay):this.actionIndicatorShow(loc,overlay)}function actionIndicatorShow(loc,overlay=!0){$("#indicator").is(":visible")||($("#indicator").hasClass("progress")||$("#indicator").addClass("progress"),setCenter("indicator",!0,!0),$("#indicator").show()),overlay===!0&&this.overlayBoxShow()}function actionIndicatorHide(loc,overlay=!0){$("#indicator").hide(),overlay===!0&&overlayBoxHide()}function overlayBoxShow(){$("#overlayBox").is(":visible")?$("#overlayBox").css("zIndex","100"):($("#overlayBox").show(),$("#overlayBox").css("zIndex","98"))}function overlayBoxHide(){parseInt($("#overlayBox").css("zIndex"))>=100?$("#overlayBox").css("zIndex","98"):$("#overlayBox").hide()}function setOverlayBox(){$("#overlayBox").is(":visible")||$("#overlayBox").show()}function hideOverlayBox(){$("#overlayBox").is(":visible")&&$("#overlayBox").hide()}function ClearCall(){$("#actionBox").html(""),$("#actionBox").hide(),$("#overlayBox").hide()}var ActionIndicatorOverlayBox=class{#GL_OB_S=100;#GL_OB_BASE=100;showActionIndicator(loc){if($("#indicator").length==0){var el=document.createElement("div");el.className="progress hide",el.id="indicator",$("body").append(el)}else $("#indicator").hasClass("progress")||$("#indicator").addClass("progress").hide();$("#indicator").is(":visible")||(this.checkOverlayExists(),$("#overlayBox").is(":visible")||$("#overlayBox").show(),$("#overlayBox").css("zIndex",1e3),$("#indicator").show(),setCenter("indicator",!0,!0))}hideActionIndicator(loc){$("#indicator").is(":visible")&&($("#indicator").hide(),this.#GL_OB_S>this.#GL_OB_BASE?$("#overlayBox").css("zIndex",this.#GL_OB_S):($("#overlayBox").hide(),$("#overlayBox").css("zIndex",this.#GL_OB_BASE)))}checkOverlayExists(){if($("#overlayBox").length==0){var el=document.createElement("div");el.className="overlayBoxElement hide",el.id="overlayBox",$("body").append(el)}}showOverlayBoxLayers(el_id){$("#overlayBox").is(":visible")||($("#overlayBox").show(),$("#overlayBox").css("zIndex",this.#GL_OB_BASE),this.#GL_OB_S=this.#GL_OB_BASE),this.#GL_OB_S++,$("#overlayBox").css("zIndex",this.#GL_OB_S),el_id&&$("#"+el_id).length>0&&($("#"+el_id).css("zIndex",this.#GL_OB_S+1),$("#"+el_id).show())}hideOverlayBoxLayers(el_id=""){this.#GL_OB_S--,this.#GL_OB_S<=this.#GL_OB_BASE?(this.#GL_OB_S=this.#GL_OB_BASE,$("#overlayBox").hide(),$("#overlayBox").css("zIndex",this.#GL_OB_BASE)):$("#overlayBox").css("zIndex",this.#GL_OB_S),el_id&&($("#"+el_id).hide(),$("#"+el_id).css("zIndex",0))}clearCallActionBox(){$("#actionBox").html(""),$("#actionBox").hide(),this.hideOverlayBoxLayers()}};var l10nTranslation=class{#i18n={};constructor(i18n2){this.#i18n=i18n2}__(string){return typeof this.#i18n<"u"&&isObject(this.#i18n)&&this.#i18n[string]?this.#i18n[string]:string}};var ActionBox=class{zIndex={base:100,max:110,indicator:0,boxes:{},active:[],top:""};action_box_storage={};action_box_cache_timeout=600*1e3;hec;l10n;constructor(hec2,l10n2){this.hec=hec2,this.l10n=l10n2}showFillActionBox(target_id="actionBox",content="",action_box_css=[],override=0,content_override=0){this.fillActionBox(target_id,content,action_box_css),this.showActionBox(target_id,override,content_override)}fillActionBox(target_id="actionBox",content="",action_box_css=[]){exists(target_id)||$("#mainContainer").after(this.hec.phfo(this.hec.cel("div",target_id,"",["actionBoxElement","hide"].concat(action_box_css)))),$("#"+target_id).html(content)}adjustActionBox(target_id="actionBox",override=0,content_override=0){this.adjustActionBoxHeight(target_id,override,content_override),setCenter(target_id,!0,!0)}hideAllActionBoxes(){$('#actionBox, div[id^="actionBox-"].actionBoxElement').hide(),$("#overlayBox").hide()}hideActionBox(target_id="actionBox"){this.closeActionBoxFloat(target_id,!1)}showActionBox(target_id="actionBox",override=0,content_override=0,hide_all=!0){this.showActionBoxFloat(target_id,override,content_override,hide_all)}closeActionBox(target_id="actionBox",clean=!0){this.closeActionBoxFloat(target_id,clean)}showActionBoxFloat(target_id="actionBox",override=0,content_override=0,hide_all=!1){hide_all===!0&&this.hideAllActionBoxes(),exists("overlayBox")||($("body").prepend(this.hec.phfo(this.hec.cel("div","overlayBox","",["overlayBoxElement"]))),$("#overlayBox").css("zIndex",this.zIndex.base)),$("#overlayBox").show(),objectKeyExists(this.zIndex.boxes,target_id)?this.zIndex.boxes[target_id]+10<this.zIndex.max&&(this.zIndex.boxes[target_id]=this.zIndex.max,this.zIndex.max+=10):(this.zIndex.boxes[target_id]=this.zIndex.max,this.zIndex.max+=10),this.zIndex.indicator||$("#overlayBox").css("zIndex",this.zIndex.boxes[target_id]-1),$("#"+target_id).css("zIndex",this.zIndex.boxes[target_id]).show(),this.zIndex.active.indexOf(target_id)==-1&&this.zIndex.active.push(target_id),this.zIndex.top=target_id,this.adjustActionBox(target_id,override,content_override)}closeActionBoxFloat(target_id="actionBox",clean=!0){if(!exists(target_id))return;objectKeyExists(this.action_box_storage,target_id)&&clean===!0&&(this.action_box_storage[target_id]={}),clean===!0&&$("#"+target_id).html(""),$("#"+target_id).hide();let idx=this.zIndex.active.indexOf(target_id);this.zIndex.active.splice(idx,1);let visible_zIndexes=$('#actionBox:visible, div[id^="actionBox-"].actionBoxElement:visible').map((i,el)=>({id:el.id,zIndex:$("#"+el.id).css("zIndex")})).get();if(visible_zIndexes.length>0){let max_zIndex=0,max_el_id="";for(let zIndex_el of visible_zIndexes)parseInt(zIndex_el.zIndex)>max_zIndex&&(max_zIndex=parseInt(zIndex_el.zIndex),max_el_id=zIndex_el.id);$("#overlayBox").css("zIndex",max_zIndex-1),this.zIndex.top=max_el_id}else $("#overlayBox").hide()}createActionBox(target_id="actionBox",title="",contents={},headers={},settings={},show_close=!0){objectKeyExists(this.action_box_storage,target_id)||(this.action_box_storage[target_id]={});let header_css=[];objectKeyExists(settings,"header_css")&&(header_css=settings.header_css);let action_box_css=[];objectKeyExists(settings,"action_box_css")&&(action_box_css=settings.action_box_css);let elements=[];elements.push(this.hec.phfo(this.hec.aelx(this.hec.cel("div",target_id+"_title","",["actionBoxTitle","flx-spbt"].concat(header_css)),...show_close===!0?[this.hec.cel("div","",title,["fs-b","w-80"]),this.hec.aelx(this.hec.cel("div",target_id+"_title_close_button","",["w-20","tar"]),this.hec.cel("input",target_id+"_title_close","",["button-close","fs-s"],{type:"button",value:this.l10n.__("Close"),OnClick:"closeActionBox('"+target_id+"', false);"}))]:[this.hec.cel("div","",title,["fs-b","w-100"])]))),getObjectCount(headers)>0&&(objectKeyExists(headers,"raw_string")?elements.push(headers.raw_string):elements.push(this.hec.phfo(headers))),getObjectCount(contents)>0?objectKeyExists(contents,"raw_string")?elements.push(contents.raw_string):elements.push(this.hec.phfo(contents)):elements.push(this.hec.phfo(this.hec.cel("div",target_id+"_content","",[]))),elements.push(this.hec.phfo(this.hec.aelx(this.hec.cel("div",target_id+"_footer","",["pd-5","flx-spbt"]),...show_close===!0?[this.hec.cel("div","","",["fs-b","w-80"]),this.hec.aelx(this.hec.cel("div",target_id+"_footer_close_button","",["tar","w-20"]),this.hec.cel("input",target_id+"_footer_close","",["button-close","fs-s"],{type:"button",value:this.l10n.__("Close"),OnClick:"closeActionBox('"+target_id+"', false);"}))]:[this.hec.cel("div","","",["fs-b","w-100"])]))),elements.push(this.hec.phfo(this.hec.cel("input",target_id+"-cache_time","",[],{type:"hidden",value:Date.now()}))),this.fillActionBox(target_id,elements.join(""),action_box_css)}adjustActionBoxHeight(target_id="actionBox",override=0,content_override=0){var new_height=0,dim={},abc_dim={},content_id="";switch(isNaN(override)&&(override=0),isNaN(content_override)&&(content_override=0),target_id){case"actionBox":content_id="action_box";break;case"actionBoxSub":content_id="action_box_sub";break;default:content_id=target_id;break}$.each([target_id,content_id+"_content"],function(i,v){$("#"+v).css({height:"",width:""})}),exists(content_id+"_title")&&(dim.height=$("#"+content_id+"_title").outerHeight(),console.log("Target: %s, Action box Title: %s",target_id,dim.height),new_height+=dim.height??0),exists(content_id+"_header")&&(dim.height=$("#"+content_id+"_header").outerHeight(),console.log("Target: %s, Action box Header: %s",target_id,dim.height),new_height+=dim.height??0),exists(content_id+"_content")&&(content_override>0?(console.log("Target: %s, Action box Content Override: %s",target_id,content_override),new_height+=content_override):(abc_dim.height=$("#"+content_id+"_content").outerHeight(),console.log("Target: %s, Action box Content: %s",target_id,abc_dim.height),new_height+=abc_dim.height??0)),exists(content_id+"_footer")&&(dim.height=$("#"+content_id+"_footer").outerHeight(),console.log("Target: %s, Action box Footer: %s",target_id,dim.height),new_height+=dim.height??0),new_height+=override;var viewport=getWindowSize();if(new_height>=viewport.height){exists(content_id+"_content")&&($("#"+content_id+"_content").hasClass("of-s-y")||$("#"+content_id+"_content").addClass("of-s-y")),console.log("Target: %s, Viewport: %s, ActionBox (NH): %s, ABcontent: %s, ABouter: %s",target_id,viewport.height,new_height,abc_dim.height,$("#"+target_id).outerHeight());var m_height=viewport.height-(new_height-(abc_dim.height??0));console.log("Target: %s, New ABcontent: %s",target_id,m_height),$("#"+content_id+"_content").css("height",m_height+"px"),new_height=new_height-(abc_dim.height??0)+m_height,console.log("Target: %s, New Hight: %s",target_id,new_height)}else exists(content_id+"_content")&&$("#"+content_id+"_content").hasClass("of-s-y")&&$("#"+content_id+"_content").removeClass("of-s-y");console.log("Target: %s, Action Box new height: %s px (override %s px, content override %s px), window height: %s px, Visible Height: %s px",target_id,new_height,override,content_override,viewport.height,$("#"+content_id).outerHeight()),$("#"+target_id).css("height",new_height+"px")}};var LoginNavMenu=class{hec;l10n;constructor(hec2,l10n2){this.hec=hec2,this.l10n=l10n2}createLoginRow(login_string,header_id="mainHeader"){exists(header_id)&&(exists("loginRow")||$("#"+header_id).html(this.hec.phfo(this.hec.cel("div","loginRow","",["loginRow","flx-spbt"]))),$("#loginRow").html(this.hec.phfo(this.hec.cel("div","loginRow-name",login_string))),$("#loginRow").append(this.hec.phfo(this.hec.cel("div","loginRow-info",""))),$("#loginRow").append(this.hec.phfo(this.hec.aelx(this.hec.cel("div","loginRow-logout"),this.hec.cel("input","logout","",[],{value:this.l10n.__("Logout"),type:"button",onClick:"loginLogout()"})))))}createNavMenu(nav_menu,header_id="mainHeader"){if(isObject(nav_menu)&&getObjectCount(nav_menu)>1){exists("menuRow")||$("#"+header_id).html(this.hec.phfo(this.hec.cel("div","menuRow","",["menuRow","flx-s"])));var content=[];$.each(nav_menu,function(key,item){key!=0&&content.push(this.hec.phfo(this.hec.cel("div","","·",["pd-2"]))),item.enabled&&(window.location.href.indexOf(item.url)!=-1&&(item.selected=1),content.push(this.hec.phfo(this.hec.aelx(this.hec.cel("div"),this.hec.cel("a","",item.name,["pd-2"].concat(item.selected?"highlight":""),{href:item.url})))))}),$("#menuRow").html(content.join(""))}else $("#menuRow").hide()}};function isWebkit(){return"GestureEvent"in window}function isMobileWebKit(){return"ongesturechange"in window}function isDesktopWebKit(){return typeof window<"u"&&"safari"in window&&"pushNotification"in window.safari}var aiob=new ActionIndicatorOverlayBox,hec=new HtmlElementCreator,l10n=new l10nTranslation(typeof i18n>"u"?{}:i18n),ab=new ActionBox(hec,l10n),lnm=new LoginNavMenu(hec,l10n);String.prototype.format||(String.prototype.format=function(){return console.error("[DEPRECATED] use StringHelpers.formatString"),formatString(this,arguments)}),Number.prototype.round&&(Number.prototype.round=function(prec){return console.error("[DEPRECATED] use MathHelpers.roundPrecision"),roundPrecision(this,prec)}),String.prototype.escapeHTML||(String.prototype.escapeHTML=function(){return console.error("[DEPRECATED] use HtmlHelpers.escapeHtml"),escapeHtml(this)}),String.prototype.unescapeHTML||(String.prototype.unescapeHTML=function(){return console.error("[DEPRECATED] use HtmlHelpers.unescapeHtml"),unescapeHtml(this)});function escapeHtml2(string){return escapeHtml(string)}function roundPrecision2(number,prec){return roundPrecision(number,prec)}function formatString2(string,...args){return formatString(string,...args)}function unescapeHtml2(string){return unescapeHtml(string)}function loadEl2(el_id){return loadEl(el_id)}function pop2(theURL,winName,features){pop(theURL,winName,features)}function expandTA2(ta_id){expandTA(ta_id)}function getWindowSize2(){return getWindowSize()}function getScrollOffset2(){return getScrollOffset()}function getScrollOffsetOpener2(){return getScrollOffsetOpener()}function setCenter2(id,left,top){setCenter(id,left,top)}function goToPos2(element,offset=0,duration=500,base="body,html"){goToPos(element,offset,duration,base)}function goTo2(target){goTo(target)}function __(string){return l10n.__(string)}function numberWithCommas2(x){return numberWithCommas(x)}function convertLBtoBR2(string){return convertLBtoBR(string)}function getTimestamp2(){return getTimestamp()}function dec2hex2(dec){return dec2hex(dec)}function generateId2(len){return generateId(len)}function randomIdF2(){return randomIdF()}function getRandomIntInclusive2(min,max){return getRandomIntInclusive(min,max)}function isFunction2(name){return isFunction(name)}function executeFunctionByName2(functionName,context){return executeFunctionByName(functionName,context)}function isObject2(val){return isObject(val)}function isArray2(val){return isArray(val)}function isIterable2(val){return isIterable(val)}function getObjectCount2(object){return getObjectCount(object)}function keyInObject2(key,object){return keyInObject(key,object)}function getKeyByValue2(object,value){return getKeyByValue(object,value)}function valueInObject2(object,value){return valueInObject(object,value)}function deepCopyFunction2(inObject){return deepCopyFunction(inObject)}function exists2(id){return exists(id)}function formatBytes2(bytes){return formatBytes(bytes)}function formatBytesLong2(bytes){return formatBytesLong(bytes)}function stringByteFormat2(bytes){return stringByteFormat(bytes)}function errorCatch2(err){errorCatch(err)}function actionIndicator2(loc,overlay=!0){actionIndicator(loc,overlay)}function actionIndicatorShow2(loc,overlay=!0){actionIndicatorShow(loc,overlay)}function actionIndicatorHide2(loc,overlay=!0){actionIndicatorHide(loc,overlay)}function overlayBoxShow2(){overlayBoxShow()}function overlayBoxHide2(){overlayBoxHide()}function setOverlayBox2(){setOverlayBox()}function hideOverlayBox2(){hideOverlayBox()}function ClearCall2(){ClearCall()}function showActionIndicator(loc){aiob.showActionIndicator(loc)}function hideActionIndicator(loc){aiob.hideActionIndicator(loc)}function checkOverlayExists(){aiob.checkOverlayExists()}function showOverlayBoxLayers(el_id){aiob.showOverlayBoxLayers(el_id)}function hideOverlayBoxLayers(el_id=""){aiob.hideOverlayBoxLayers(el_id)}function clearCallActionBox(){aiob.clearCallActionBox()}function cel(tag,id="",content="",css=[],options={}){return hec.cel(tag,id,content,css,options)}function ael(base,attach,id=""){return hec.ael(base,attach,id)}function aelx(base,...attach){return hec.aelx(base,...attach)}function aelxar(base,attach){return hec.aelxar(base,attach)}function rel(base){return hec.rel(base)}function rcssel(_element,css){return hec.rcssel(_element,css)}function acssel(_element,css){return hec.acssel(_element,css)}function scssel(_element,rcss,acss){hec.scssel(_element,rcss,acss)}function phfo(tree){return hec.phfo(tree)}function phfa(list){return hec.phfa(list)}function html_options2(name,data,selected="",options_only=!1,return_string=!1,sort=""){return html_options(name,data,selected,options_only,return_string,sort)}function html_options_block2(name,data,selected="",multiple=0,options_only=!1,return_string=!1,sort="",onchange=""){return html_options_block(name,data,selected,multiple,options_only,return_string,sort,onchange)}function html_options_refill2(name,data,sort=""){html_options_refill(name,data,sort)}function parseQueryString2(query="",return_key="",single=!1){return parseQueryString(query,return_key,single)}function getQueryStringParam2(search="",query="",single=!1){return getQueryStringParam(search,query,single)}function updateUrlParameter2(key,value,reload=!1){return updateUrlParameter(key,value,reload)}function removeUrlParameter2(key,reload=!1){return removeUrlParameter(key,reload)}function hasUrlParameter2(key){return hasUrlParameter(key)}function getUrlParameter2(key){return getUrlParameter(key)}function loginLogout2(){loginLogout()}function createLoginRow(login_string,header_id="mainHeader"){lnm.createLoginRow(login_string,header_id)}function createNavMenu(nav_menu,header_id="mainHeader"){lnm.createNavMenu(nav_menu,header_id)}function showFillActionBox(target_id="actionBox",content="",action_box_css=[],override=0,content_override=0){ab.showFillActionBox(target_id,content,action_box_css,override,content_override)}function fillActionBox(target_id="actionBox",content="",action_box_css=[]){ab.fillActionBox(target_id,content,action_box_css)}function adjustActionBox(target_id="actionBox",override=0,content_override=0){ab.adjustActionBox(target_id,override,content_override)}function hideAllActionBoxes(){ab.hideAllActionBoxes()}function hideActionBox(target_id="actionBox"){ab.hideActionBox(target_id)}function showActionBox(target_id="actionBox",override=0,content_override=0,hide_all=!0){ab.showActionBox(target_id,override,content_override,hide_all)}function closeActionBox(target_id="actionBox",clean=!0){ab.closeActionBox(target_id,clean)}function showActionBoxFloat(target_id="actionBox",override=0,content_override=0,hide_all=!1){ab.showActionBoxFloat(target_id,override,content_override,hide_all)}function closeActionBoxFloat(target_id="actionBox",clean=!0){ab.closeActionBoxFloat(target_id,clean)}function createActionBox(target_id="actionBox",title="",contents={},headers={},settings={},show_close=!0){ab.createActionBox(target_id,title,contents,headers,settings,show_close)}function adjustActionBoxHeight(target_id="actionBox",override=0,content_override=0){ab.adjustActionBoxHeight(target_id,override,content_override)}function isWebkit2(){return isWebkit()}function isMobileWebKit2(){return isMobileWebKit()}function isDesktopWebKit2(){return isDesktopWebKit()}
|
|
//# sourceMappingURL=utils.min.js.map
|