{"version":3,"sources":["Dialogs.js","ExternalPages.js","SnapOnline.js","TabLayout.js"],"names":["snapOnline","$","applyAutofocusToDynamicDialogContent","autofocusTarget","find","first","focus","data","select","updateDynamicDialogLayout","dialog","scroller","length","css","window","innerHeight","setDynamicDialogContentAndOpen","content","open","closeDynamicDialogWindow","windowObject","close","applyAutofocusToDynamicLogInDialogContent","Dialogs","changeDynamicDialogWindowTitle","title","setOptions","onDynamicDialogContentRefreshed","addWaitSpinnerToDialog","dialogWindow","getWaitSpinnerImage","openQwizardWindow","contentUrl","modal","draggable","width","height","kendo","ui","progress","element","refresh","center","closeSharedDialogWindow","createDynamicDialogWindow","id","kendoWindow","iframe","scrollable","resizable","pinned","actions","position","top","left","innerWidth","activate","deactivate","destroy","createDynamicLogInDialogWindow","onDynamicLogInDialogContentRefreshed","closeDynamicLogInDialogWindow","updateDynamicLogInDialogLayout","changeDynamicDialogLogInWindowTitle","immediatelyDestroyDynamicDialogWindow","closeCustomDialog","dialogSelector","remove","messageDialog","text","messageAndButton","append","html","click","confirmDialog","question","Promise","resolve","reject","message","buttons","waitDialog","waitImgUrl","getSolBaseUrl","kendoDialog","closable","createDownloadDialog","url","createResponseDownloadDialog","exportFormatid","val","parseInt","ResponsesPage","getExportOptionFlags","onDownloadReady","cookieName","waitForCookie","then","document","cookie","noop","showErrorMessage","iconAndMessage","SnapOnline","jQuery","ExternalPages","onLoginFormSubmitted","form","validate","valid","prop","addClass","hide","hideElementUnlessCapsLockOn","event","elementId","getModifierState","getElementById","style","display","Recaptcha","responseid","getResourceActionUrl","params","response","__RequestVerificationToken","getRequestVerificationToken","post","done","captchaResponse","parseJSON","Response","success","show","error","toggleDeviceName","checked","removeClass","saveCookieStatus","toggle","localStorage","setItem","kendoEncode","value","replace","kendoGridFilterQuery","gridName","filterState","grid","dataSourceState","dataSource","transport","parameterMap","filter","sort","group","attr","charAt","substring","getCurrentResourceId","getControllerUrl","controllerName","join","getActionUrl","actionName","resourceId","param","replaceElementWithAjaxGet","get","fail","jqXhr","textStatus","errorThrown","getEnabledDisabledImage","enabledTitle","disabledTitle","getYesNoDontKnowImage","getEnabledImageIfTrue","getWarningImageIfTrue","warningTitle","size","filename","isInIframe","self","e","showDropDown","target","srcElement","closest","stopPropagation","one","flashSelection","jquerySelection","fadeIn","fadeOut","onAccordionItemClicked","sender","siblings","onAccordionPanelClicked","menuItems","next","datePicker","format","kendoDatePicker","getCookie","cookies","split","n","item","trim","indexOf","timeout","remainingAttempts","downloadInterval","setInterval","clearInterval","setIframeHeightToFitContents","frame","minimumHeight","Math","max","contentWindow","body","scrollHeight","showSpinner","ShowBuildTab","hideBuildTab","HideBuildTab","forceRefresh","location","href","checkForInvalidCharacters","invalidCharDetected","initializeClipboard","button","clipboard","ClipboardJS","on","clearSelection","label","delay","this","trigger","after","toggleMFASettings","toggleClass","initMFASettings","launchMFAConfigureDialog","paddingLeft","closeMFADialog","deleteTrustedDevice","ID","deviceName","navigateAwayFromEditorHandler","TabLayout","setActivePanelId","panelId","panelLink","refreshSurveyTitleAndStatus","setNavigateAwayFromEditorHandler","remoteHandler","preventDefault"],"mappings":";AAAA,cAEA,SAAAA,EAAAC,GAGA,SAAAC,IACA,IAAAC,EAAAF,EAAA,wBAAAG,KAAA,oBAAAC,QACAF,IACAA,EAAAG,QACAH,EAAAI,KAAA,qBACAJ,EAAAK,UAOA,SAAAC,IACA,IAAAC,EAAAT,EAAA,wBACAU,EAAAD,EAAAN,KAAA,kCACAM,EAAAN,KAAA,yBACAQ,QACAF,EAAAG,IAAA,UAAA,KAEAF,EAAAC,QACAD,EAAAE,IAAA,aAAAC,OAAAC,YAAA,KAKA,SAAAC,EAAAN,EAAAO,GACAP,EAAAO,QAAAA,GACAR,IACAC,EAAAQ,OAIA,SAAAC,IACA,IAAAC,EAAAnB,EAAA,wBAAAM,KAAA,eACAa,GACAA,EAAAC,QAsJA,SAAAC,IACA,IAAAnB,EAAAF,EAAA,6BAAAG,KAAA,oBAAAC,QACAF,IACAA,EAAAG,Q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AAoD,MAEA5H,EAAAoG,OAhTA,CAkTAtF,OAAAyF,WAAAzF,OAAAyF,YAAA,GAAAC,QCrTA,IAAAqJ,8BAAA,MAEA,SAAA7P,EAAAC,GAEAD,EAAA8P,UAAA9P,EAAA8P,WAAA,GAMA9P,EAAA8P,UAAAC,iBAAA,SAAAC,GACA,IAAAC,EAAAhQ,EAAA,IAAA+P,GACAC,EAAArP,SACAqP,EAAA5D,WAAA5D,YAAA,UACAwH,EAAAlJ,SAAA,YAMA/G,EAAA8P,UAAAI,4BAAA,WACAlQ,EAAAuK,0BAAA,SAAAvK,EAAA0H,qBAAA,WAAA,YAMA1H,EAAA8P,UAAAK,iCAAA,SAAAC,GACA,GAAAA,EAAA,CACA,GAAA,OAAAP,8BAAA,CAMA5P,EAAA,mCAAAwE,MALA,SAAA+G,GAGA,OAFAA,EAAA6E,iBACAR,8BAAA5P,EAAAuL,EAAAE,QAAAE,QAAA,KAAAhC,KAAA,UACA,IAIAiG,8BAAAO,IAnCA,CAsCAtP,OAAAyF,WAAAzF,OAAAyF,YAAA,GAAAC","file":"utils.min.js","sourcesContent":["'use strict';\r\n\r\n(function (snapOnline, $) {\r\n // Called when then Dynamic Dialog Window loads new content or finishes the 'open' animation;\r\n // we use it to ensure any autofocus element receives focus.\r\n function applyAutofocusToDynamicDialogContent() {\r\n var autofocusTarget = $('#dynamicDialogWindow').find('input[autofocus]').first();\r\n if (autofocusTarget) {\r\n autofocusTarget.focus();\r\n if (autofocusTarget.data('auto-select-text')) {\r\n autofocusTarget.select();\r\n }\r\n }\r\n }\r\n\r\n // Updates the layout of the Dynamic Dialog window to ensure that the outer padding (provided by\r\n // Kendo) is removed if the content is placed within our own padded container.\r\n function updateDynamicDialogLayout() {\r\n var dialog = $('#dynamicDialogWindow');\r\n var scroller = dialog.find('.modal-dialog-content-scroller');\r\n var content = dialog.find('.modal-dialog-content');\r\n if (content.length) {\r\n dialog.css('padding', '0');\r\n }\r\n if (scroller.length) {\r\n scroller.css('max-height', window.innerHeight - 270);\r\n }\r\n }\r\n\r\n // Sets the content of the Dynamic Dialog Window, updates its layout, then opens the window.\r\n function setDynamicDialogContentAndOpen(dialog, content) {\r\n dialog.content(content);\r\n updateDynamicDialogLayout();\r\n dialog.open();\r\n }\r\n\r\n // Closes and destroys the Kendo Window created by createDynamicDialogWindow().\r\n function closeDynamicDialogWindow() {\r\n var windowObject = $('#dynamicDialogWindow').data('kendoWindow');\r\n if (windowObject) {\r\n windowObject.close();\r\n }\r\n }\r\n\r\n // Ensure required nested namespaces are declared.\r\n snapOnline.Dialogs = snapOnline.Dialogs || {};\r\n\r\n // ----- Public interface from here -----\r\n\r\n snapOnline.Dialogs.changeDynamicDialogWindowTitle = function (title) {\r\n var windowObject = $('#dynamicDialogWindow').data('kendoWindow');\r\n if (windowObject) {\r\n windowObject.setOptions({\r\n title: title\r\n });\r\n }\r\n\r\n return;\r\n };\r\n\r\n // Ensures the Dynamic Dialog Window fits within the screen nicely, and that the first input is focused.\r\n snapOnline.Dialogs.onDynamicDialogContentRefreshed = function () {\r\n updateDynamicDialogLayout();\r\n applyAutofocusToDynamicDialogContent();\r\n };\r\n\r\n // Fills the specified dialog with a 'wait spinner'.\r\n // The 'dialogWindow' parameter should be a Kendo window.\r\n snapOnline.Dialogs.addWaitSpinnerToDialog = function (dialogWindow) {\r\n dialogWindow.content('
' + snapOnline.getWaitSpinnerImage() + '
');\r\n };\r\n\r\n // Opens the Qwizard Window, loading content from the specified URL.\r\n snapOnline.Dialogs.openQwizardWindow = function (title, contentUrl) {\r\n var windowObject = $('#qwizardWindow').data('kendoWindow');\r\n windowObject.setOptions({\r\n title: title,\r\n modal: true,\r\n draggable: false,\r\n width: '85%',\r\n height: '85%'\r\n });\r\n windowObject.content('');\r\n kendo.ui.progress(windowObject.element, true);\r\n windowObject.refresh(contentUrl);\r\n windowObject.center();\r\n windowObject.open();\r\n };\r\n\r\n // Closes the common Kendo Dialog Window that is created and used from the server-rendered pages.\r\n snapOnline.Dialogs.closeSharedDialogWindow = function () {\r\n var windowObject = $('#dialogWindow').data('kendoWindow');\r\n if (windowObject) {\r\n windowObject.close();\r\n }\r\n };\r\n\r\n // Creates a Kendo Window that is horizontally-centered, placed near the top of the screen, and that resizes vertically to neatly fit its contents.\r\n snapOnline.Dialogs.createDynamicDialogWindow = function (width, title) {\r\n var dialogWindow = $('#dynamicDialogWindow').data('kendoWindow');\r\n if (!dialogWindow) {\r\n $('
', { id: 'dynamicDialogWindow' }).kendoWindow({});\r\n dialogWindow = $('#dynamicDialogWindow').data('kendoWindow');\r\n }\r\n\r\n dialogWindow.setOptions({\r\n modal: true,\r\n iframe: false,\r\n draggable: false,\r\n scrollable: true,\r\n resizable: false,\r\n pinned: false,\r\n actions: ['Close'],\r\n title: title,\r\n width: width,\r\n height: null,\r\n position: {\r\n top: 100,\r\n left: (window.innerWidth - width) / 2\r\n },\r\n refresh: snapOnline.Dialogs.onDynamicDialogContentRefreshed,\r\n activate: applyAutofocusToDynamicDialogContent,\r\n deactivate: function () {\r\n $('#dynamicDialogWindow').data('kendoWindow').destroy();\r\n }\r\n });\r\n\r\n snapOnline.Dialogs.addWaitSpinnerToDialog(dialogWindow);\r\n return dialogWindow;\r\n };\r\n\r\n //Login window functions\r\n snapOnline.Dialogs.createDynamicLogInDialogWindow = function (width, title) {\r\n var dialogWindow = $('#dynamicLogInDialogWindow').data('kendoWindow');\r\n if (!dialogWindow) {\r\n $('
', { id: 'dynamicLogInDialogWindow' }).kendoWindow({});\r\n dialogWindow = $('#dynamicLogInDialogWindow').data('kendoWindow');\r\n }\r\n\r\n dialogWindow.setOptions({\r\n modal: true,\r\n iframe: false,\r\n draggable: false,\r\n scrollable: true,\r\n resizable: false,\r\n pinned: false,\r\n actions: [],\r\n title: title,\r\n width: width,\r\n height: null,\r\n position: {\r\n top: 100,\r\n left: (window.innerWidth - width) / 2\r\n },\r\n refresh: snapOnline.Dialogs.onDynamicLogInDialogContentRefreshed,\r\n activate: applyAutofocusToDynamicLogInDialogContent,\r\n deactivate: function () {\r\n //$('#dynamicLogInDialogWindow').data('kendoWindow').destroy();\r\n //Leave it there for the next time. It will disappear but it won't be destroyed.\r\n }\r\n });\r\n\r\n snapOnline.Dialogs.addWaitSpinnerToDialog(dialogWindow);\r\n return dialogWindow;\r\n };\r\n\r\n snapOnline.Dialogs.closeDynamicLogInDialogWindow = function () {\r\n var windowObject = $('#dynamicLogInDialogWindow').data('kendoWindow');\r\n if (windowObject) {\r\n windowObject.close();\r\n }\r\n };\r\n\r\n snapOnline.Dialogs.onDynamicLogInDialogContentRefreshed = function () {\r\n updateDynamicLogInDialogLayout();\r\n applyAutofocusToDynamicLogInDialogContent();\r\n };\r\n\r\n function updateDynamicLogInDialogLayout() {\r\n var dialog = $('#dynamicLogInDialogWindow');\r\n var scroller = dialog.find('.modal-dialog-content-scroller');\r\n var content = dialog.find('.modal-dialog-content');\r\n if (content.length) {\r\n dialog.css('padding', '0');\r\n }\r\n if (scroller.length) {\r\n scroller.css('max-height', window.innerHeight - 270);\r\n }\r\n }\r\n\r\n function applyAutofocusToDynamicLogInDialogContent() {\r\n var autofocusTarget = $('#dynamicLogInDialogWindow').find('input[autofocus]').first();\r\n if (autofocusTarget) {\r\n autofocusTarget.focus();\r\n if (autofocusTarget.data('auto-select-text')) {\r\n autofocusTarget.select();\r\n }\r\n }\r\n }\r\n\r\n snapOnline.Dialogs.changeDynamicDialogLogInWindowTitle = function (title) {\r\n var windowObject = $('#dynamicLogInDialogWindow').data('kendoWindow');\r\n if (windowObject) {\r\n windowObject.setOptions({\r\n title: title\r\n });\r\n }\r\n\r\n return;\r\n };\r\n //END Login window functions\r\n\r\n // Closes and destroys the Kendo Window created by createDynamicDialogWindow().\r\n snapOnline.Dialogs.closeDynamicDialogWindow = closeDynamicDialogWindow;\r\n\r\n // Immediately closes the Dynamic Dialog Window, if it exists (without a closing animation).\r\n snapOnline.Dialogs.immediatelyDestroyDynamicDialogWindow = function () {\r\n var dialogWindow = $('#dynamicDialogWindow').data('kendoWindow');\r\n if (dialogWindow) {\r\n dialogWindow.destroy();\r\n }\r\n };\r\n\r\n // Closes and destroys a custom client-side dialog created by one of the functions below.\r\n snapOnline.Dialogs.closeCustomDialog = function (dialogSelector) {\r\n dialogSelector.data('kendoDialog').close().destroy();\r\n dialogSelector.remove();\r\n };\r\n\r\n // Shows an informational message.\r\n snapOnline.Dialogs.messageDialog = function (text, title) {\r\n var messageAndButton = $('
')\r\n .append($('
').append($('
').html(text)))\r\n .append($('
').append($('
')\r\n .append($('').click(closeDynamicDialogWindow).append('OK')))\r\n );\r\n\r\n var dialog = snapOnline.Dialogs.createDynamicDialogWindow(350, title || 'Message');\r\n setDynamicDialogContentAndOpen(dialog, messageAndButton);\r\n };\r\n\r\n // Shows a confirmation dialog, with OK and Cancel buttons.\r\n // Returns a Promise that resolves if the user clicks OK, otherwise rejects.\r\n snapOnline.Dialogs.confirmDialog = function (question, title) {\r\n return new Promise(function (resolve, reject) {\r\n var message = $('
').append($('
').append($('
').html(question)));\r\n var buttons = $('
');\r\n buttons.append($('
').append($('').click(function () {\r\n closeDynamicDialogWindow();\r\n reject();\r\n }).append('Cancel')));\r\n buttons.append($('
').append($('').click(function () {\r\n closeDynamicDialogWindow();\r\n resolve(true);\r\n }).append('OK')));\r\n\r\n var dialogWindow = snapOnline.Dialogs.createDynamicDialogWindow(400, title);\r\n dialogWindow.setOptions({\r\n actions: []\r\n });\r\n setDynamicDialogContentAndOpen(dialogWindow, $('
').append([message, buttons]));\r\n });\r\n };\r\n\r\n // Creates a new client-side Wait Dialog, and returns its selector.\r\n snapOnline.Dialogs.waitDialog = function (text, title) {\r\n var waitImgUrl = snapOnline.getSolBaseUrl() + '/Content/Images/smallspinner.gif';\r\n var dialogSelector = $('
');\r\n dialogSelector.kendoDialog({\r\n closable: false,\r\n modal: true,\r\n width: 400,\r\n title: title || 'Please wait',\r\n content: '

' + text + '

',\r\n actions: []\r\n });\r\n dialogSelector.data('kendoDialog').open();\r\n return dialogSelector;\r\n };\r\n\r\n // Launches a dialog that will indicate a data export is in-progress, prior to download.\r\n // The data might be response data, a Snap Database Link output, or Participants export.\r\n snapOnline.Dialogs.createDownloadDialog = function (url) {\r\n var windowObject = snapOnline.Dialogs.createDynamicDialogWindow(500, 'Preparing download...');\r\n windowObject.refresh(url);\r\n windowObject.open();\r\n };\r\n\r\n //Specific to downloading responses as the format is obtained from a hiddn field that is held in the selctedFormatId dom element\r\n snapOnline.Dialogs.createResponseDownloadDialog = function (url) {\r\n var exportFormatid = $('input[id=selectedFormatId]').val();\r\n url = url + '&formatId=' + parseInt(exportFormatid);\r\n var snapExportOptionFlag = 0;\r\n snapExportOptionFlag = snapOnline.ResponsesPage.getExportOptionFlags();\r\n\r\n url = url + '&exportOptions=' + snapExportOptionFlag;\r\n\r\n snapOnline.Dialogs.createDownloadDialog(url);\r\n };\r\n\r\n // Called from ExportDownload.cshtml; it initiates the download, then watches for a cookie (set by the arrival of the download),\r\n // and closes the pop-up dialog when this cookie is found.\r\n snapOnline.Dialogs.onDownloadReady = function (cookieName) {\r\n $('#dynamicDialogWindow').data('kendoWindow').setOptions({ title: 'Download ready' });\r\n snapOnline.waitForCookie(cookieName).then(function () {\r\n snapOnline.Dialogs.closeDynamicDialogWindow();\r\n document.cookie = cookieName + '=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;'; // Remove the cookie.\r\n }, snapOnline.noop);\r\n $('#auto-download-link')[0].click();\r\n };\r\n\r\n // Shows an error message, either in the existing dynamic dialog window, or in a new dialog.\r\n snapOnline.Dialogs.showErrorMessage = function (message) {\r\n var dialogSelector = $('#dynamicDialogWindow');\r\n var iconAndMessage = '
 ' + message + '
';\r\n if (dialogSelector.length) {\r\n dialogSelector.data('kendoWindow').content(iconAndMessage);\r\n updateDynamicDialogLayout();\r\n } else {\r\n var dialog = snapOnline.Dialogs.createDynamicDialogWindow(400, 'Error');\r\n setDynamicDialogContentAndOpen(dialog, iconAndMessage);\r\n }\r\n };\r\n}(window.SnapOnline = window.SnapOnline || {}, jQuery));\r\n","'use strict';\r\n\r\n// Functions for external pages (those accessible without logging in).\r\n(function (snapOnline, $) {\r\n // Ensure required nested namespaces are declared.\r\n snapOnline.ExternalPages = snapOnline.ExternalPages || {};\r\n\r\n // Enhances the login page by disabling duplicate submissions once the \"Log in\" button has been clicked.\r\n snapOnline.ExternalPages.onLoginFormSubmitted = function () {\r\n var form = $('#loginForm');\r\n form.validate();\r\n if (form.valid()) {\r\n form.find(':input').prop('readonly', true);\r\n form.find(':button').prop('disabled', true).addClass('loading');\r\n $('#loginFailedMessage').hide();\r\n }\r\n };\r\n // Toggles the \"display\" CSS property of the specified element, depending upon the keyboard's Caps Lock state.\r\n snapOnline.ExternalPages.hideElementUnlessCapsLockOn = function (event, elementId) {\r\n if ((typeof event.getModifierState) !== 'undefined') {\r\n if (event.getModifierState('CapsLock')) {\r\n document.getElementById(elementId).style.display = 'initial';\r\n } else {\r\n document.getElementById(elementId).style.display = 'none';\r\n }\r\n }\r\n };\r\n\r\n snapOnline.ExternalPages.Recaptcha = function (responseid) {\r\n var url = snapOnline.getResourceActionUrl('Account', 'VerifyCaptcha');\r\n var params = {\r\n response: responseid,\r\n __RequestVerificationToken: snapOnline.getRequestVerificationToken()\r\n };\r\n jQuery.post(url, params)\r\n .done(function (response) {\r\n var captchaResponse = jQuery.parseJSON(response.Response);\r\n if (captchaResponse.success) {\r\n $('#hfCaptcha').val(captchaResponse.success);\r\n $('#rfvCaptcha').hide();\r\n } else {\r\n $('#hfCaptcha').val('');\r\n $('#rfvCaptcha').show();\r\n var error = captchaResponse['error-codes'][0];\r\n $('#rfvCaptcha').html('RECaptcha error. ' + error);\r\n }\r\n });\r\n };\r\n\r\n snapOnline.ExternalPages.toggleDeviceName = function () {\r\n var rememberCheckBox = $('#RememberBrowser');\r\n if (rememberCheckBox[0].checked) {\r\n $('#deviceDiv').removeClass('hidden');\r\n } else {\r\n $('#deviceDiv').addClass('hidden');\r\n } \r\n };\r\n\r\n snapOnline.ExternalPages.saveCookieStatus = function () {\r\n $('#cookieBanner').toggle();\r\n localStorage.setItem('HideCookieBanner', 'true');\r\n };\r\n}(window.SnapOnline = window.SnapOnline || {}, jQuery));\r\n","'use strict';\r\n\r\n// This file must be included in an environment that also includes the ClipboardJS library.\r\n/* global ClipboardJS */\r\n\r\n(function (snapOnline, $) {\r\n // ----- Public interface from here -----\r\n\r\n // An empty function (that can be used with Promises, for example).\r\n snapOnline.noop = function () {\r\n };\r\n\r\n // Encodes a string to make it safe for use in a Kendo ClientTemplate.\r\n snapOnline.kendoEncode = function (value) {\r\n return value.replace(\"'\", ''');\r\n };\r\n\r\n // Get the filters from a Kendo grid. Its a [DataSourceRequest] in theory\r\n snapOnline.kendoGridFilterQuery = function (gridName) {\r\n var filterState = '';\r\n var grid = $('#' + gridName);\r\n if (grid !== null) {\r\n grid = grid.data('kendoGrid');\r\n }\r\n if (grid !== null) { \r\n var dataSourceState = grid.dataSource.transport.parameterMap({ filter: grid.dataSource.filter(), sort: grid.dataSource.sort() });\r\n filterState = '&filter=' + dataSourceState.filter\r\n + '&group=' + dataSourceState.group\r\n + '&sort=' + dataSourceState.sort;\r\n }\r\n return filterState;\r\n };\r\n\r\n\r\n // Gets the Snap Online base URL, from a meta tag. The URL\r\n // will *not* include a trailing slash.\r\n snapOnline.getSolBaseUrl = function () {\r\n var url = $('meta[name=\"sol-base\"]').attr('value');\r\n if (url.charAt(url.length - 1) === '/') {\r\n url = url.substring(0, url.length - 1);\r\n }\r\n return url;\r\n };\r\n\r\n // Gets a string containing the GUID of the current Resource.\r\n snapOnline.getCurrentResourceId = function () {\r\n return $('meta[name=\"sol-resource-id\"]').attr('value');\r\n };\r\n\r\n // Obtain the anti-forgery token embedded in the current page.\r\n snapOnline.getRequestVerificationToken = function () {\r\n return $('input[name=\"__RequestVerificationToken\"]').val();\r\n };\r\n\r\n // Returns a string containing the URL path of the specified ASP.NET MVC Controller.\r\n snapOnline.getControllerUrl = function (controllerName) {\r\n return [snapOnline.getSolBaseUrl(), controllerName].join('/');\r\n };\r\n\r\n // Returns a string containing the URL path to the specified ASP.NET MVC Action.\r\n snapOnline.getActionUrl = function (controllerName, actionName) {\r\n return [snapOnline.getSolBaseUrl(), controllerName, actionName].join('/');\r\n };\r\n\r\n // Returns a string containing the URL path to the specified ASP.NET MVC Action,\r\n // for the current (default) or specified resource, with optional query-string parameters.\r\n snapOnline.getResourceActionUrl = function (controllerName, actionName, resourceId, params) {\r\n var url = [\r\n snapOnline.getActionUrl(controllerName, actionName),\r\n resourceId || snapOnline.getCurrentResourceId()\r\n ].join('/');\r\n return params ? [url, $.param(params)].join('?') : url;\r\n };\r\n\r\n // An alternative for Ajax.ActionLink() that can be called from code, linked to buttons etc.\r\n snapOnline.replaceElementWithAjaxGet = function (elementId, url) {\r\n return new Promise(function (resolve, reject) {\r\n jQuery.get(url)\r\n .done(function (response) {\r\n $('#' + elementId).html(response);\r\n resolve(response);\r\n })\r\n .fail(function (jqXhr, textStatus, errorThrown) {\r\n reject(jqXhr, textStatus, errorThrown);\r\n });\r\n });\r\n };\r\n\r\n // Returns HTML for an image tag that shows an icon indicating an enabled or disabled state.\r\n // The enabled and disabled titles can optionally be provided.\r\n snapOnline.getEnabledDisabledImage = function (value, enabledTitle, disabledTitle) {\r\n enabledTitle = (typeof enabledTitle === 'undefined') ? 'Enabled' : enabledTitle;\r\n disabledTitle = (typeof disabledTitle === 'undefined') ? 'Disabled' : disabledTitle;\r\n if (value) {\r\n return '';\r\n } else {\r\n return '';\r\n }\r\n };\r\n\r\n // Returns HTML for an image tag that shows an icon indicating a yes, no, don't know state.\r\n snapOnline.getYesNoDontKnowImage = function (value) {\r\n if (value === 0) {\r\n return '';\r\n } else if (value === 1) {\r\n return '';\r\n } else {\r\n return '';\r\n }\r\n };\r\n\r\n // Returns HTML for an image tag that shows an 'positive' icon if value=true, or nothing otherwise.\r\n snapOnline.getEnabledImageIfTrue = function (value, enabledTitle) {\r\n return value ? snapOnline.getEnabledDisabledImage(true, enabledTitle) : '';\r\n };\r\n\r\n // Returns HTML for an image tag that shows an 'warning' icon if value=true, or nothing otherwise.\r\n snapOnline.getWarningImageIfTrue = function (value, warningTitle) {\r\n warningTitle = (typeof warningTitle === 'undefined') ? 'Warning' : warningTitle;\r\n return value ? '' : '';\r\n };\r\n\r\n // Returns HTML for an image tag that shows a \"please wait\" spinner.\r\n snapOnline.getWaitSpinnerImage = function (size) {\r\n var filename = (size === 'small') ? 'smallspinner.gif' : 'spinner.gif';\r\n return '';\r\n };\r\n\r\n // Returns a Boolean indicating if the current script is hosted inside an IFrame.\r\n snapOnline.isInIframe = function () {\r\n try {\r\n return window.self !== window.top;\r\n } catch (e) {\r\n return true;\r\n }\r\n };\r\n\r\n // Handles the click in a clickable drop-down button / menu.\r\n snapOnline.showDropDown = function (e) {\r\n var target = $(e.srcElement).closest('.clickable-dropdown').find('.dropdown-content').first();\r\n if ((target.length > 0) && (target.css('display') === 'none')) {\r\n e.stopPropagation();\r\n target.css('display', 'inline-block');\r\n $(document).one('click', function () { target.css('display', 'none'); });\r\n }\r\n };\r\n\r\n // 'Flashes' the elements in the specified jQuery selection, to draw attention to them.\r\n snapOnline.flashSelection = function (jquerySelection) {\r\n jquerySelection.fadeIn(100).fadeOut(100).fadeIn(100).fadeOut(100).fadeIn(100);\r\n };\r\n\r\n // Called when a user clicks on a menu-item within an accordion panel. It updates the DOM to highlight the \"current page\".\r\n snapOnline.onAccordionItemClicked = function (sender) {\r\n if (sender) {\r\n var element = $(sender);\r\n element.siblings().removeClass('active');\r\n element.addClass('active');\r\n }\r\n };\r\n\r\n // Handles the click on an Accordion header, where the accordion is essentially a \"section-based menu\".\r\n // Replaces the MainPanel with the specified URL, and highlights the first item in the section.\r\n snapOnline.onAccordionPanelClicked = function (sender, url) {\r\n if (url) {\r\n snapOnline.replaceElementWithAjaxGet('MainPanel', url);\r\n }\r\n if (sender) {\r\n var menuItems = $(sender).next().find('ul.sublist li');\r\n menuItems.removeClass('active');\r\n menuItems.first().addClass('active');\r\n }\r\n };\r\n\r\n snapOnline.datePicker = function (element) {\r\n var format = $('meta[name=\"sol-date-format\"]').attr('value');\r\n\r\n element.kendoDatePicker({\r\n format: format // set custom defined format\r\n });\r\n };\r\n\r\n // Returns the value of the specified cookie, or NULL if no such cookie is found.\r\n snapOnline.getCookie = function (cookieName) {\r\n cookieName += '=';\r\n var cookies = document.cookie.split(';');\r\n for (var n = 0; n < cookies.length; n++) {\r\n var item = cookies[n].trim();\r\n if (item.indexOf(cookieName) === 0) {\r\n return item.substring(cookieName.length, item.length);\r\n }\r\n }\r\n return null;\r\n };\r\n\r\n // Returns a promise that resolves when a cookie with the specified name exists, or rejects if a timeout is reached first.\r\n snapOnline.waitForCookie = function (cookieName, timeout) {\r\n var remainingAttempts = timeout || 30;\r\n return new Promise(function (resolve, reject) {\r\n var downloadInterval = setInterval(function () {\r\n if (snapOnline.getCookie(cookieName)) {\r\n clearInterval(downloadInterval);\r\n resolve();\r\n }\r\n if (remainingAttempts-- <= 0) {\r\n clearInterval(downloadInterval);\r\n reject();\r\n }\r\n }, 1000);\r\n });\r\n };\r\n\r\n // Set an IFrame's height to fit its contents.\r\n snapOnline.setIframeHeightToFitContents = function (frame, minimumHeight) {\r\n frame.style.height = 0;\r\n // Note: the \"24\" on the line below is an unfortunate but apparently-necessary \"magic number\", without\r\n // which the IFrame seems to end up slightly too small.\r\n frame.style.height = (Math.max(minimumHeight || 0, frame.contentWindow.document.body.scrollHeight) + 24) + 'px';\r\n };\r\n\r\n snapOnline.showSpinner = function () {\r\n $('#waitSpinner').show();\r\n };\r\n\r\n snapOnline.ShowBuildTab = function (id) {\r\n var prompt = 'Are you sure you want to allow access to the build tab?';\r\n snapOnline.Dialogs.confirmDialog(prompt, 'Access build tab?').then(function () {\r\n var url = snapOnline.getResourceActionUrl('UAResource', 'ToggleBuildTab', id);\r\n jQuery.post(url, { __RequestVerificationToken: snapOnline.getRequestVerificationToken(), hideBuildTab: false });\r\n }, snapOnline.noop);\r\n };\r\n\r\n snapOnline.HideBuildTab = function (id) {\r\n var prompt = 'Are you sure you want to hide access to the build tab?';\r\n snapOnline.Dialogs.confirmDialog(prompt, 'Hide build tab?').then(function () {\r\n var url = snapOnline.getResourceActionUrl('UAResource', 'ToggleBuildTab', id);\r\n jQuery.post(url, { __RequestVerificationToken: snapOnline.getRequestVerificationToken(), hideBuildTab: true });\r\n }, snapOnline.noop);\r\n };\r\n\r\n snapOnline.forceRefresh = function () {\r\n window.location = window.location.href;\r\n };\r\n\r\n snapOnline.checkForInvalidCharacters = function () {\r\n var invalidCharDetected = jQuery('#UserName').val().indexOf('<', 0) > 0 || jQuery('#UserName').val().indexOf('>', 0) > 0;\r\n if (invalidCharDetected) {\r\n var prompt = 'User name not permitted to have < or >';\r\n snapOnline.Dialogs.messageDialog(prompt, 'Invalid characters');\r\n }\r\n return !invalidCharDetected;\r\n };\r\n\r\n snapOnline.initializeClipboard = function (button) {\r\n var clipboard = new ClipboardJS(button, {\r\n text: function () {\r\n return $(button).attr('data-copyable-text');\r\n }\r\n });\r\n\r\n clipboard.on('success', function (e) {\r\n e.clearSelection();\r\n var label = jQuery('').addClass('copyableTextCopied margin-left-1em').text('Copied').delay(800).fadeOut(500, function () {\r\n $(this).remove();\r\n });\r\n $(e.trigger).closest('.sol-input-addon-container').first().after(label);\r\n });\r\n\r\n return clipboard;\r\n };\r\n\r\n snapOnline.toggleMFASettings = function () {\r\n $('#mfaOptions').toggleClass('hidden');\r\n };\r\n\r\n snapOnline.initMFASettings = function () {\r\n var enableMFA = $('#enableMFA');\r\n if (enableMFA[0].checked) {\r\n $('#mfaOptions').removeClass('hidden');\r\n } else {\r\n $('#mfaOptions').addClass('hidden');\r\n }\r\n };\r\n\r\n snapOnline.launchMFAConfigureDialog = function () {\r\n $('#configureEmail').css({ top: '50px', height: '0px', width: '400px', paddingLeft: '10px' });\r\n $('#configureApp').css({ top: '50px', height: '0px', width: '400px' });\r\n var windowObject = snapOnline.Dialogs.createDynamicDialogWindow(600, 'Configure MFA');\r\n windowObject.refresh(snapOnline.getResourceActionUrl('Account', 'ConfigureMFA'));\r\n windowObject.open();\r\n };\r\n\r\n snapOnline.closeMFADialog = function (message) {\r\n snapOnline.replaceElementWithAjaxGet('MainPanel', snapOnline.getResourceActionUrl('Account', 'Security'));\r\n if ((message === '') || (message === null)) {\r\n snapOnline.Dialogs.closeDynamicDialogWindow();\r\n } else {\r\n snapOnline.Dialogs.messageDialog(message, 'Configure MFA');\r\n }\r\n };\r\n\r\n\r\n snapOnline.deleteTrustedDevice = function (ID, deviceName) {\r\n snapOnline.Dialogs.confirmDialog('Are you sure you want to delete \"' + deviceName + '\"?', 'Delete trusted device').then(function () {\r\n var url = snapOnline.getResourceActionUrl('Account', 'DeleteTrustedDevice', ID);\r\n jQuery.post(url, { __RequestVerificationToken: snapOnline.getRequestVerificationToken() })\r\n .done(function (response) {\r\n $('#MainPanel').html(response);\r\n });\r\n }, snapOnline.noop);\r\n };\r\n}(window.SnapOnline = window.SnapOnline || {}, jQuery));\r\n","'use strict';\r\n\r\nvar navigateAwayFromEditorHandler = null;\r\n\r\n(function (snapOnline, $) {\r\n // Ensure required nested namespaces are declared.\r\n snapOnline.TabLayout = snapOnline.TabLayout || {};\r\n\r\n // ----- Public interface from here -----\r\n\r\n // Adds the 'active' CSS class to the element with the specified ID, and removes\r\n // it from all siblings. Used to highlight an item in the accordion.\r\n snapOnline.TabLayout.setActivePanelId = function (panelId) {\r\n var panelLink = $('#' + panelId);\r\n if (panelLink.length) {\r\n panelLink.siblings().removeClass('active');\r\n panelLink.addClass('active');\r\n }\r\n };\r\n\r\n // Refresh the \"legend\" - this is the Survey name and status (such as \"My Survey - Started, 3 respondents\")\r\n // that appears above the four main tabs of the application.\r\n snapOnline.TabLayout.refreshSurveyTitleAndStatus = function () {\r\n snapOnline.replaceElementWithAjaxGet('legend', snapOnline.getResourceActionUrl('Resource', 'Legend'));\r\n };\r\n\r\n // Registers a function, provided by the JS Survey Editor, which is called when the user\r\n // clicks on any link in the SOL \"header\" area (which would have the effect of leaving\r\n // the editor). This allows the editor to display a friendly \"are you sure?\" message.\r\n snapOnline.TabLayout.setNavigateAwayFromEditorHandler = function (remoteHandler) {\r\n if (remoteHandler) {\r\n if (navigateAwayFromEditorHandler === null) {\r\n var handler = function (e) {\r\n e.preventDefault();\r\n navigateAwayFromEditorHandler($(e.target).closest('a').attr('href'));\r\n return false;\r\n };\r\n $('a[data-editor-intercepts-click]').click(handler);\r\n }\r\n navigateAwayFromEditorHandler = remoteHandler;\r\n }\r\n };\r\n}(window.SnapOnline = window.SnapOnline || {}, jQuery));\r\n"]}