{"version":3,"file":"../js/lfjs.js","names":["lfjs","$","isdocumentready","path","version","bubble","domobj","message","args","event","belowContent","hide","attr","replace","length","createBubble","is","prevdomobj","width","bubbleTheme","addClass","find","html","closeBtn","document","createElement","id","href","role","click","e","preventDefault","keypress","ev","charCode","prepend","position","calculatePosition","tail","show","css","top","left","stopImmediatePropagation","blur","setTimeout","body","bind","toReturn","off","offset","dw","w","h","height","removeClass","windowHeight","window","docTop","scrollTop","docBottom","bottom","right","unbind","focus","div","appendTo","defaultKeyHandler","key","jQuery"],"sources":["lfjs.js"],"sourcesContent":["var lfjs = lfjs || {};\n\n\n(function ($) {\n 'use strict';\n\n lfjs.isdocumentready = false;\n lfjs.path = '';\n lfjs.version = 20190909\n\n lfjs.bubble = function(domobj, message, args, event, belowContent) {\n lfjs.bubble.hide();\n if(typeof lfjs.path == \"undefined\")\n lfjs.path = $(\"script[src$='lfjs.js']:first\").attr(\"src\").replace(/\\/[^\\/]*$/, \"\");\n if(typeof message == \"undefined\" || message.length == 0)\n return;\n if(typeof args == \"undefined\")\n var args = {};\n if(typeof lfjs.bubble.domobj == \"undefined\") {\n lfjs.bubble.createBubble();\n }\n //if dom obj is not visible (i.e. gone or in an old bubble), try to use the previous dom obj\n if(!$(domobj).is(\":visible\")) {\n if(lfjs.bubble.prevdomobj)\n domobj = lfjs.bubble.prevdomobj;\n } else {\n lfjs.bubble.prevdomobj = domobj;\n }\n var width = 225;\n if(typeof args.width != \"undefined\")\n width = args.width;\n $(lfjs.bubble.domobj).width(width);\n\n if(typeof(bubbleTheme) !== \"undefined\")\n $(\".lfjsbubble\").addClass(bubbleTheme);\n\n $(lfjs.bubble.domobj).find(\".lfjsbubblecontent\").html(message);\n if(!$(lfjs.bubble.domobj).find(\"#lfjsbubbleclose\").length) {\n var closeBtn = document.createElement(\"a\");\n $(closeBtn).attr({ id: \"lfjsbubbleclose\", href: \"#\", role: \"button\" })\n .html('Close')\n .click(function(e) {\n e.preventDefault();\n lfjs.bubble.hide();\n })\n .keypress(function(ev) {\n if(ev.charCode && ev.charCode === 32) {\n //close on space bar, because it's acting as a button\n ev.preventDefault();\n lfjs.bubble.hide();\n }\n });\n $(lfjs.bubble.domobj).prepend(closeBtn);\n }\n $(lfjs.bubble.domobj).find(\".lfjsbubblecontent\").html(message);\n if (domobj) {\n var position = lfjs.bubble.calculatePosition(domobj, belowContent);\n var tail = $(\".lfjsbubbletail\");\n tail.show();\n\n $(lfjs.bubble.domobj).css({ position: \"absolute\", top: position.top, left: position.left}).show().click(function() {\n return false;\n });\n\n $(lfjs.bubble.domobj).find(\"a, :input\").click(function(event) {\n event.stopImmediatePropagation();\n return true;\n });\n domobj.blur();\n setTimeout(function() {\n $(document.body).bind(\"click.hidebubble\", function(event) {\n lfjs.bubble.hide();\n });\n }, 1);\n }\n }\n lfjs.bubble.calculatePosition = function(domobj, belowContent) {\n belowContent = (typeof belowContent != \"undefined\") ? belowContent : false;\n\n //Return object with top/left locations\n var toReturn = {};\n\n if (!domobj)\n return;\n\n var off = $(domobj).offset();\n var dw = $(domobj).width();\n\n var w = $(lfjs.bubble.domobj).width();\n var h = $(lfjs.bubble.domobj).height();\n\n toReturn.top = off.top - h - 20;\n toReturn.left = off.left - ((w - 70) - (dw / 2));\n\n //Top will be changed depending on whether we are rendering above or below the content\n var tail = $(\".lfjsbubbletail\");\n tail.removeClass(\"top left\");\n\n if (belowContent)\n {\n toReturn.top = toReturn.top + (height) + 30; //Calculate new top\n tail.addClass(\"top\"); //Add top class to flip the image\n return;\n }\n\n //Check if bubble will be out of sight (above or below)\n var windowHeight = $(window).height();\n var docTop = $(window).scrollTop();\n var docBottom = docTop + windowHeight;\n\n //Calculate the new bottom\n // (add twice the height to get bottom of bubble displayed below)\n var bottom = toReturn.top + (2*h) + 20;\n\n if ((bottom >= docBottom) && (toReturn.top <= docTop))\n {\n //Off of top of screen completely or Off screen on both top and bottom - display based on which is off by the \"least\"\n if (toReturn.top < 0 || ((bottom - docBottom) < (docTop - toReturn.top)))\n {\n //Off on bottom by more than it is on top... display on top\n toReturn.top = toReturn.top + (h) + 30; //Calculate new top\n tail.addClass(\"top\"); //Add top class to flip the tail\n }\n }\n\n //Off on top - display below\n else if (toReturn.top <= docTop)\n {\n toReturn.top = toReturn.top + (h) + 55; //Calculate new top\n tail.addClass(\"top\"); //Add top class to flip the tail\n }\n\n\n //center bubble tail overr domobj\n if (toReturn.left < 0) {\n var right = w - (off.left + 25)\n //console.log(\"Right: \" + right + \" - Width: \" + w)\n tail.css(\"right\", right + \"px\")\n toReturn.left = 0;\n }\n else\n {\n tail.css(\"right\", \"70px\")\n }\n\n return toReturn;\n };\n\n lfjs.bubble.hide = function() {\n if (typeof lfjs.bubble.domobj != \"undefined\") {\n $(lfjs.bubble.domobj).hide().unbind('keydown.keepfocus');\n }\n $(document.body).unbind(\"click.hidebubble\");\n $(lfjs.bubble.prevdomobj).focus();\n }\n lfjs.bubble.createBubble = function() {\n if(typeof lfjs.bubble.domobj != \"undefined\")\n return;\n var div = document.createElement(\"div\");\n var html = '