{"version":3,"sources":["../js/ProgressBar.js"],"names":["g_oProgressBar","addProgressBar","message","showPercentage","$","is","lockScreen","show","text","hide","updateProressBar","percentLoaded","parseFloat","css","width","removeProgressBar","unlockScreen"],"mappings":"AAaA,IAAIA,eAAiB,CAOpBC,eAAgB,SAAUC,QAASC,gBAG9BC,EAAE,mBAAmBC,GAAG,aAC3BC,aACAF,EAAE,mBAAmBG,QAItBH,EAAE,qBAAqBI,KAAKN,SAGxBC,eACHC,EAAE,4BAA4BG,OAG9BH,EAAE,4BAA4BK,QAShCC,iBAAkB,SAAUC,cAAeT,SAEtCA,SACHE,EAAE,qBAAqBI,KAAKN,SAIRU,WAAWR,EAAE,0BAA0BS,IAAI,UAAYT,EAAE,4BAA4BU,QAAU,IAGhHH,eACHP,EAAE,0BAA0BS,IAAI,QAASF,cAAgB,MAO3DI,kBAAmB,WAGlBC,eAGAZ,EAAE,qBAAqBI,KAAK,IAC5BJ,EAAE,0BAA0BS,IAAI,QAAS,MAGzCT,EAAE,mBAAmBK","file":"ProgressBar-bc97cf77b5.js","sourcesContent":["/*\r\n * Copyright (c) 2018 SGS Europe. All rights reserved.\r\n *\r\n * This program is the CONFIDENTIAL and PROPRIETARY property of SGS Europe.\r\n * Any unauthorised use, reproduction, or transfer of this program is strictly\r\n * prohibited.\r\n *\r\n * File Name:\tProgressBar.js\r\n *\r\n * Description: Contains the functions required for adding, updating and removing the progress bar.\r\n *\r\n */\r\n\r\nvar g_oProgressBar = {\r\n\r\n /**\r\n * Adds the progress bar to the page.\r\n * @param {string} message - The message to display.\r\n\t * @param {bool} showPercentage - If the percentage bar should be shown.\r\n */\r\n\taddProgressBar: function (message, showPercentage) {\r\n\r\n\t\t// Show the progress bar, locking the screen.\r\n\t\tif ($(\"#divProgressBar\").is(\":hidden\")) {\r\n\t\t\tlockScreen();\r\n\t\t\t$(\"#divProgressBar\").show();\r\n\t\t}\r\n\r\n\t\t// Update the message.\r\n\t\t$(\"#spLoadingMessage\").text(message);\r\n\r\n\t\t// Toggle the visibility of the percentage.\r\n\t\tif (showPercentage) {\r\n\t\t\t$(\"#divLoadingProgressBarBG\").show();\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$(\"#divLoadingProgressBarBG\").hide();\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t* Updates the progress bar.\r\n\t* @param {string} percentLoaded - The percentage to display.\r\n\t* @param {string} message - The message to display.\r\n\t*/\r\n\tupdateProressBar: function (percentLoaded, message) {\r\n\t\t// Update the message if supplied.\r\n\t\tif (message) {\r\n\t\t\t$(\"#spLoadingMessage\").text(message);\r\n\t\t}\r\n\r\n\t\t// Get the current width of the progress bar.\r\n\t\tvar currentPercent = parseFloat($(\"#divLoadingProgressBar\").css(\"width\")) / $(\"#divLoadingProgressBarBG\").width() * 100;\r\n\r\n\t\t// Update the percentage bar only if the new percentage is greater than the current percentage.\r\n\t\tif (percentLoaded > currentPercent) {\r\n\t\t\t$(\"#divLoadingProgressBar\").css(\"width\", percentLoaded + \"%\");\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t* Removes the progress bar from the page.\r\n\t*/\r\n\tremoveProgressBar: function () {\r\n\r\n\t\t// Unlock the screen.\r\n\t\tunlockScreen();\r\n\r\n\t\t// Reset the message and percentage.\r\n\t\t$(\"#spLoadingMessage\").text(\"\");\r\n\t\t$(\"#divLoadingProgressBar\").css(\"width\", \"0%\");\r\n\r\n\t\t// Hide the progress bar.\r\n\t\t$(\"#divProgressBar\").hide();\r\n\t}\r\n};"]}